define(function (require) {
    var router = require("plugins/router");
    var ko = require("knockout");
    var childRouter = router.createChildRouter()
        .makeRelative({
            moduleId: "backApp/plan",
            fromParent: true
        }).map([
            {route: "", moduleId: "edit/select/index", title: "抓取计划管理", type: "intro", nav: false},
            {route: "backAccountSelect", moduleId: "edit/select/index", title: "抓取计划管理", type: "intro", nav: 10},
            {route: "backAccountUpdate/:id", moduleId: "edit/update/index", title: "编辑抓取计划", type: "intro", nav: false},
            {route: "backAccountCreate", moduleId: "edit/create/index", title: "新建抓取计划", type: "intro", nav: false},
            {route: "review/:id", moduleId: "review/select/index", title: "网站资源监控", type: "intro", nav: false},
            {route: "trace/:id", moduleId: "review/trace/index", title: "网站链接溯源", type: "intro", nav: false},
            {route: "review/param/:id", moduleId: "review/param/index", title: "网站资源监控参数设置", type: "intro", nav: false},
            {route: "actions/:planId", moduleId: "edit/each/index", title: "抓取任务浏览", type: "intro", nav: false},
            {route: "keyword/:planId", moduleId: "review/keyword/index", title: "关键词搜索", type: "intro", nav: false},
            {
                route: "sourceKeyword/:planId",
                moduleId: "review/source_keyword/index",
                title: "源码搜索",
                type: "intro",
                nav: false
            },
            {route: "images/:planId", moduleId: "review/images/index", title: "图片资源监控", type: "intro", nav: false}
            /*,{ route: "roleUpdate/:id", moduleId: "role/update/index", title: "修改权限", type: "intro", nav: false },
            { route: "studentAccountSelect", moduleId: "studentAccount/select/index", title: "学生账号管理", type: "intro", nav: 40 },
            { route: "studentAccountUpdate/:id", moduleId: "studentAccount/update/index", title: "修改学生账号信息", type: "intro", nav: false },
            { route: "studentAccountResetPassword/:id", moduleId: "studentAccount/resetPassword/index", title: "修改学生账号密码", type: "intro", nav: false },
            { route: "teacherAccountSelect", moduleId: "teacherAccount/select/index", title: "教师账号管理", type: "intro", nav: 50 },
            { route: "teacherAccountUpdate/:id", moduleId: "teacherAccount/update/index", title: "修改教师账号信息", type: "intro", nav: false },
            { route: "teacherAccountResetPassword/:id", moduleId: "teacherAccount/resetPassword/index", title: "修改教师账号密码", type: "intro", nav: false }*/
        ]).buildNavigationModel();

    return {
        router: childRouter, //the property on the view model should be called router
        compositionComplete: function () {
            layui.use(["element"], function () {
                var element = layui.element;
                element.render();
            });
        }
    };
});